package com.xmut.mall.member.feign;

import com.xmut.mall.member.utils.R;
import com.xmut.mall.member.utils.RespBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient("mall-coupon")
public interface CouponFeignService {

    /**
     * 获取购物车结算时可用的满减活动
     *
     * @param skuIds
     * @return
     */
    @PostMapping("/coupon/fulldiscount/getCartCheckFullDiscount")
    RespBean getCartCheckFullDiscount(@RequestBody List<Long> skuIds);

    /**
     * 领取优惠券后减少优惠券数量
     *
     * @param params
     * @return
     */
    @PostMapping("/coupon/coupon/reduceCouponNum")
    RespBean reduceCouponNum(@RequestBody Map<String, Object> params);


    /**
     * 根据ID获取优惠券
     *
     * @param id
     * @return
     */
    @GetMapping("/coupon/coupon/getCoupon/{id}")
    RespBean getCoupon(@PathVariable Long id);

    /**
     * 根据商铺Id获取购物车中可用的优惠券
     *
     * @param storeId
     * @return
     */
    @GetMapping("/coupon/coupon/getCartShopCoupon/{storeId}")
    RespBean getCartShopCoupon(@PathVariable Long storeId);

    @GetMapping("/test/testFeign")
    R testFeign(@RequestParam String str);

    @PostMapping("/coupon/coupon/getCouponByIds")
    RespBean getCouponByIds(@RequestBody List<Long> ids);
}
